import { Application } from 'egg';

export default (app: Application) => {
    const { STRING, INTEGER, CHAR } = app.Sequelize;
    const model = app.model.define('Advert', {
        advert_id: { type: CHAR(32), primaryKey: true },//主键id
        advert_order: INTEGER(20),//序号
        advert_type: CHAR(1),//类型（1：活动，2：超链接）
        advert_partment: STRING(100),//所属部门
        advert_picture: STRING(100),//活动图片
        advert_status: CHAR(1),//状态（1：正常，2：停用）
        created_by: CHAR(32),//创建人
        updated_by: CHAR(32),//更新人
        is_delete: CHAR(1),//是否删除（1：否，2：是）
    }, { tableName: 't_advert' });
    return model;
};

export class Advert {
    advert_id: string;
    advert_order: string;
    advert_type: number;
    advert_partment: string;
    advert_picture: string;
    advert_status: string;
    created_by: string;
    updated_by: string;
    is_delete: string;
}